<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>trimStart 与 trimEnd</title>
</head>
<body>
  <script>
    //trim 
    let str = '     iloveyou   ';
    
    console.log(str);
    console.log(str.trimStart());
    console.log(str.trimEnd());
  </script>
</body>
</html>